﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ApprovalRule.aspx.cs" Inherits="Ebiz.ApprovalRule" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="js/ApprovalRule.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <h3>Approval Rules</h3>
    <form id="Form1" runat="server">
        <div id="divRules" style="margin:5px 75px;">
            <div id="ruleInfo" style="margin:0 45px; display:none;">
                <table id="tblRuleInfo" style="width:100%;" cellspacing="3" cellpadding="6">
                    <tr>
                        <td style="table-layout:fixed;width:136px;padding:6px 3px;">Scenario</td><td style="table-layout:fixed;width:6px;">:</td>
                        <td style="table-layout:fixed;width:100px;">
                            <select name="cbScenario" id="cbScenario" style="font-size:12px; font-family: Arial, Helvetica, sans-serif;">
                                <option value="0">--- Select ---</option>
                            </select>
                        </td>
                        <td>
                            <div id="btnEdit" class="btnSmall" style="display:none;margin-right:5px;" title="Edit Layers">Edit Layers</div>
                            <div id="btnDelScenario" class="btnSmall" style="display:none;" title="Delete Scenario">Delete Scenario</div>
                        </td>
                    </tr>
                    <tr><td colspan="4">&nbsp;</td></tr>
                    <tr>
                        <td>Rule Control</td><td>:</td>
                        <td colspan="2"><span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td>Conditions</td><td>:</td>
                        <td colspan="2"><span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td colspan="2">
                            <span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td>Fixed Discount <img id="imgInfo1" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" /></td>
                        <td>:</td>
                        <td colspan="2">
                            <span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Rule Category</td><td>:</td>
                        <td colspan="2">
                            <span style="display:none;">&nbsp;</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Total Scenario</td><td>:</td>
                        <td colspan="2"><span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Approval Layer Key <img id="imgInfo2" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" /></td>
                        <td>:</td>
                        <td colspan="2">
                            <span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Total Approval Layers  <img id="imgInfo3" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" /></td>
                        <td>:</td>
                        <td colspan="2"><span style="display:none;">&nbsp;</span></td>
                    </tr>
                    <tr>
                        <td valign="top" style="padding-top:6px;">Rule Descriptions</td><td valign="top" style="padding-top:6px;">:</td>
                        <td colspan="2" style="padding-top:6px;">
                            <span style="display:none;"></span>
                        </td>
                    </tr>
                    <tr><td colspan="4">&nbsp;</td></tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                        <td colspan="2">
                            <div id="btnClose" class="btnSmall" title="Close">Close</div>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="divAdd" style="position:relative;text-align:left;">
                <div id="btnAddRule" class="btnSmall" style="margin:10px 0 5px 0;" title="Create New Rule / Add Scenario">Add Rule</div>
            </div>
            <table id="tblRules" class="tblstyle" style="width:100%;">
                <thead>
                    <tr>
                        <th rowspan="2" style="table-layout:fixed; width:69px;">Category Code</th>
                        <th rowspan="2" style="table-layout:fixed; width:150px;">Rule Control</th>
                        <th colspan="2">Formula</th>
                        <th rowspan="2" style="table-layout:fixed; width:60px;">Fixed Discount</th>
                        <th rowspan="2" style="table-layout:fixed; width:60px;">Total Scenario</th>
                        <th rowspan="2" style="table-layout:fixed; width:30px;">Option</th>
                    </tr>
                    <tr>
                        <th>Conditions 1</th>
                        <th>Conditions 2</th>
                    </tr>
                </thead>
                <tbody>
                    <%= RuleList %>
                </tbody>
            </table>
        </div>
        <div id="divLayerEditor" style="display:none;">
            <div id="ruleWrapTitle" style="font:Arial;font-weight:bold;color:#0066FF;margin-bottom:10px;">Approval Layers Editor</div>
            <div id="ruleWrapSubTitle" style="font:Arial;font-size:12px;color:Green;">
                This is layer must be filled in order to activate the newly created rule / scenario.<br />
                <strong>Note:</strong> Approval layers can be changed anytime in Approval Rules section (administrator access).
            </div>
            <div id="ruleWrapper">
                <div id="rule-wrapper"></div>
                <div id="btnBox" style="margin-top:30px; position:relative;">
                    <div id="btnAddLayer" class="btnSmall fl_left" title="Add Approval Layer">Add Layer</div>
                    <div id="btnSaveLayer" class="btnSmall fl_right" title="Update Rule">Update</div>
                    <div id="btnCancel" class="btnSmall fl_right" style="margin-right:5px;" title="Cancel">Cancel</div>
                    <div class="cl_both"></div>
                </div>
            </div>
        </div>
    </form>
</asp:Content>
